package com.shen.GOF.simpleFactory;

public class CarFactory {
    //方法一
    public static Car getInstance(String car) {
        if (car.equals("aodi")) {
            return new Aodi();
        } else if (car.equals("bike")) {
            return new Bike();
        } else {
            return null;
        }
    }
    //方法二
    public static Car getAodi(){
        return new Aodi();
    }
    public static Car getBike(){
        return new Bike();
    }
}
